'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const {
    router,
    controller
  } = app;

  //登录
  router.post('/api/login', controller.home.login);

  //主页
  //轮播
  router.get('/api/carouse', controller.home.carouse)
  //楼市资讯
  router.get('/api/information', controller.home.information)
  //经纪人
  router.get('/api/broker', controller.home.broker);
  //楼层
  router.get('/api/houseresource', controller.home.houseresource);


  //总咨询
  router.get('/api/getsuminformation', controller.home.getsuminformation);
  //详情
  router.post('/api/informationdetail', controller.home.informationDetail);

  //经纪人详情
  router.post('/api/broker_detail', controller.broker.brokerDetail);
  //卖房
  router.post('/api/broker_sell_house', controller.broker.brokerSell);
  //租房
  router.post('/api/broker_renting_house', controller.broker.brokerRenting);

  //团购看房
  router.get('/api/group_see_house', controller.group.groupSee);
  //报名
  router.get('/api/group_add_num', controller.group.addnum);

  //求租
  router.get('/api/wanted_house', controller.wanted.getHouse);
  //点击类型
  router.get('/api/wanted_house_type', controller.wanted.getHouseType);
  //点击区域
  router.get('/api/wanted_house_area', controller.wanted.getHouseArea);

  //求购
  router.get('/api/get_buy_house', controller.buy.gebuythouse);
  //点击类型
  router.get('/api/get_buy_type', controller.buy.getBuyType);
  //点击区域
  router.get('/api/get_buy_area', controller.buy.getBuyArea);


  //买房
  router.get('/api/get_buyhouse', controller.buyhouse.getHouse);


  //直播看房
  router.get('/api/get_live_house', controller.livesee.gethouse);
  //
  router.get('/api/get_live_house_type', controller.livesee.gethousetype);
  //详情
  router.get('/api/live_see_detail', controller.livesee.gethousedetail);

  //我的
  router.get('/api/list', controller.home.index);
  router.get('/api/apyment', controller.client.my.payment)


  //买房租房
  router.get("/ipsy_home", controller.home.buy_home); //获取买房页面的初始数据
  router.get("/ipsy_home_one", controller.home.buy_home_one); //获取初始数据二
  router.get("/ipsy_home_two", controller.home.buy_home_two); //获取初始数据三
  router.get("/ipsy_home_three", controller.home.buy_home_three); //获取初始数据四
  router.get("/ipsy_home_four", controller.home.buy_home_four); //找房模糊搜索

  //找房
  router.put('/ips/send_help', controller.home.send_help); //设置用户请求
  router.get("/ips/find_home_broker", controller.home.find_home_broker); //获取经纪人的数据

};